import fetch from './fetch'

//注册接口
export function regist(data){
    return fetch({
        url:'users/regist',
        method:'POST',
        data:data
    })
}

//登录接口
export function login(data){
    return fetch({
        url:'/users/login',
        method:'POST',
        data:data
    })
}

//获取首页为你推荐的商品列表
export function getGoodList(params){
    return fetch({
        url:'/goods/getGoodList',
        method:'GET',
        params
    })
}
// 获取商品详情
export function getGoodDetail(params){
    return fetch({
        url:'/goods/getGoodDetail',
        method:'GET',
        params
    })
}
export function getAds(params){
  return fetch ({
    url:'/ads/list',
    method:'GET',
    params
  })
}




//获取商品种类
export function getAllCates(params){
  return fetch({
      url:'/cates/getAllCates',
      method:'GET',
      params
  })
}
//基于品类进行筛选
export function getFind(params){
  return fetch({
    url: '/cates/getFind',
    method: 'GET',
    params
  })
}

export default {
    regist,
    login,
    getGoodList,
    getGoodDetail,
    getAllCates,
    getFind,
    getAds,
}